package cn.itcast.itcaststore.dao.Impl;


import cn.itcast.itcaststore.dao.NoticeDao;
import cn.itcast.itcaststore.domain.Notice;
import cn.itcast.itcaststore.utils.JDBCUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class INoticeDao implements NoticeDao {
    private JdbcTemplate jdbcTemplate = new JdbcTemplate(JDBCUtils.getDataSource());

    @Override
    public List getNoticeList() {
        String getNoticeList_sql = "select*from notice ";
        List<Notice> query = jdbcTemplate.query(getNoticeList_sql, new BeanPropertyRowMapper<Notice>(Notice.class));

        return query;
    }
}
